home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / amiga.compilers / comp.sys.amiga.programmer_31299_000013.msg < prev    next >
Encoding:
Text File  |  1994-11-27  |  1.5 KB  |  44 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: cs.chalmers.se!news.chalmers.se!sunic!uunet!haven.umd.edu!darwin.sura.net!news-feed-1.peachnet.edu!concert!sas!mozart.unx.sas.com!walker
  3. From: walker@twix.unx.sas.com (Doug Walker)
  4. Subject: Re: CTRL-C Trapping
  5. Originator: walker@twix.unx.sas.com
  6. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  7. Message-ID: <C7Mvxz.1yq@unx.sas.com>
  8. Date: Wed, 26 May 1993 12:27:34 GMT
  9. References:  <dave.03zr@ddreams.UUCP>
  10. Nntp-Posting-Host: twix.unx.sas.com
  11. Organization: SAS Institute Inc.
  12. Lines: 32
  13.  
  14.  
  15. In article <dave.03zr@ddreams.UUCP>, dave@ddreams.UUCP (David Prothero) writes:
  16. |> Quick, easy question...
  17. |> 
  18. |> How do I trap a CTRL-C on a program that runs from the CLI so that I can do 
  19. |> some clean up on my program before I exit?
  20. |> 
  21. |> Thanks... reply here or via e-mail.
  22.  
  23. You don't say what language you are using.  This is very important
  24. information!  Please give us enough information to help you when
  25. you ask the question.
  26.  
  27. If you are using C, your compiler's library is trapping CTRL-C for
  28. you and exiting.  Look in your library documentation for information
  29. on how to control this.
  30.  
  31. In SAS/C 6.0, you would simply declare a function like so:
  32.  
  33.    void __regargs _CXBRK(void)
  34.    {
  35.       /* Do your cleanup here */
  36.    }
  37.  
  38. -- 
  39.   *****                    / walker@unx.sas.com
  40.  *|_o_o|\\     Doug Walker<  BIX, Portal: djwalker
  41.  *|. o.| ||                \ CompuServe: 71165,2274
  42.   | o  |//     
  43.   ====== 
  44. Any opinions expressed are mine, not those of SAS Institute, Inc.